/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package datas;

import beans.Info;
import beans.Patient;
import java.util.List;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;

/**
 *
 * @author havn
 */
@WebService(serviceName = "WebMethods")
public class WebMethods {

    private StaffObj staff;
    private PatientObj patient;
    private InfoObj info;

    public WebMethods() {
        staff = new StaffObj();
        patient = new PatientObj();
        info = new InfoObj();
    }

    @WebMethod(operationName = "Login")
    public boolean Login(@WebParam(name = "user") String user, @WebParam(name = "pass") String pass) {
        return staff.doLogin(user, pass);
    }
    //search

    @WebMethod(operationName = "SearchPatient")
    public List<Patient> SearchPatient(@WebParam(name = "keyword") String keyword) {
        return patient.doSearch(keyword);
    }

    @WebMethod(operationName = "SearchInfo")
    public List<Info> SearchInfo(@WebParam(name = "patientid") int patientid) {
        return info.select(patientid);
    }
    //insert 

    @WebMethod(operationName = "InsertInfo")
    public boolean InsertInfo(@WebParam(name = "i") Info i) {
        return info.insert(i);
    }

    @WebMethod(operationName = "InsertPatient")
    public boolean InsertPatient(@WebParam(name = "p") Patient p) {
        return patient.insert(p);
    }
}
